import request from '@/config/axios'

export interface ActivityInfoVO {
  id?: number
  name: string
  activeDate: Date
  activeTimeBegin: string
  activeTimeEnd: string
  menNum: string
  womenNum: string
  head: string
  packageType: number
  packageName: string
  activeCost: string
  deadline: Date
  activeDesc: string
  activeCover: string
  auditStatus: number
  auditUser: string
}

export interface auditActivityVO {
  id: number
  auditStatus: number
  rejectReason: string
}

// 查询相亲活动信息列表
export const getActivityInfoPage = async (params) => {
  return await request.get({ url: `/activity/info/page`, params })
}

// 查询相亲活动信息详情
export const getActivityInfo = async (id: number) => {
  return await request.get({ url: `/activity/info/get?id=` + id })
}

// 新增相亲活动信息
export const createActivityInfo = async (data: ActivityInfoVO) => {
  return await request.post({ url: `/activity/info/create`, data })
}

// 修改相亲活动信息
export const updateActivityInfo = async (data: ActivityInfoVO) => {
  return await request.put({ url: `/activity/info/update`, data })
}

// 删除相亲活动信息
export const deleteActivityInfo = async (id: number) => {
  return await request.delete({ url: `/activity/info/delete?id=` + id })
}

// 导出相亲活动信息 Excel
export const exportActivityInfo = async (params) => {
  return await request.download({ url: `/activity/info/export-excel`, params })
}

// 查询活动报名列表
export const getActivityEnrollList = async (params) => {
  return await request.get({ url: `/activity/enroll/getActivityEnrollList`, params })
}

// 审核相亲活动
export const auditActivity = async (data: auditActivityVO) => {
  return await request.post({ url: `/activity/info/auditActivity`, data })
}

// 相亲活动成立
export const establish = async (id: number) => {
  return await request.post({ url: `/activity/info/establish?id=` + id })
}
